<?php

class DiscountController extends HBaseController
{
	//设置导航焦点
	public $active_cur = 'discount';
	
	/**
	 * 促销专区首页
	 */
	public function actionIndex()
	{
		$this->render('index');
	}

	/**
	 * 促销专区列表页
	 */
	public function actionList($id){
		$model = new ProDiscount('search');
		$model->unsetAttributes();//清空属性
		$model->category_top = $id;//一级行业分类
		$model->zpd_start_time = '<'.time();//已经开始
		$model->zpd_end_time = '>'.time();//结束时间大于当前时间
		$model->zpd_status = 1;//是否关闭1否2是3删除
	
		if(isset($_GET['ProTuan'])){
			$model->attributes = $_GET['ProTuan'];
		}
	
		$this->render('list',array(
				'model'=>$model,
		));
	}
	// Uncomment the following methods and override them if needed
	/*
	public function filters()
	{
		// return the filter configuration for this controller, e.g.:
		return array(
			'inlineFilterName',
			array(
				'class'=>'path.to.FilterClass',
				'propertyName'=>'propertyValue',
			),
		);
	}

	public function actions()
	{
		// return external action classes, e.g.:
		return array(
			'action1'=>'path.to.ActionClass',
			'action2'=>array(
				'class'=>'path.to.AnotherActionClass',
				'propertyName'=>'propertyValue',
			),
		);
	}
	*/
}